import request from '@/router/axios';
import qs from 'qs'

export const getTenantTree = ( params) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/getTenantList',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/info/'+id,
    method: 'get',
    params: {
      id,
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/install',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/update',
    method: 'post',
    data: row
  })
}
export const updateStatus = (id,status) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/updateStatus',
    method: 'post',
    params: {
      id,
      status
    }
  })
}
export const jarTest = (data) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/dynamicallJar',
    method: 'post',
    data:qs.stringify(data),
    headers:  { 'Content-Type': 'application/x-www-form-urlencoded' }
  })
}
export const javascriptTest = (data) => {
  return request({
    url: '/api/blade-platform/pictureAlgorithm/dynamicallScript',
    method: 'post',
    data:qs.stringify(data),
    headers:  { 'Content-Type': 'application/x-www-form-urlencoded' }
  })
}